import http from '@/util/http'

export function imageList (search, current, pageSize) {
  return http.post(`/image/get?pageNo=${current}&pageSize=${pageSize}`, search)
}

export function imageUpload (data) {
  return http.post('/image/imageUpload', data, { headers: { 'Content-Type': 'multipart/form-data' } })
}

export function delImageByPath (path) {
  return http.delete(`/image/delete?path=${path}`)
}

export function addImage (data) {
  return http.post('/images', data)
}

export function updateImage (data) {
  return http.put('/images', data)
}

export function delImage (id) {
  return http.delete(`/images?id=${id}`)
}

export function imageById (id) {
  return http.get(`/images?id=${id}`)
}
